export default [{
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name:"home",
        // 路由懒加载 加载对应组件 更加高效 都属于前台优化
        // 只有用户实际访问该对应路由才会执行加载该组件 否则不加载不执行(因为现在是函数)
        component: () =>
            import ('@/page/Home'),
        meta: { show: true ,
            show_header:true,
            show_threeD:false,
            show_3Dpic:true
        },
    },
    {
        path: '/login',
        component: () =>
            import ('@/page/Login'),
        meta: { show: false,
        show_header:true,
        show_3Dpic:false
        },
    },
    {
        path: '/register',
        component: () =>
            import ('@/page/Register'),
        meta: { show: false ,
            show_header:true,
            show_3Dpic:false
        },
    },
    {
        name: 'Search',
        path: '/search/:keyword?',
        component: () =>
            import ('@/page/Search'),
        meta: { show: true,
            show_header:true,
            
        },
    },
    {
        name: 'Detail',
        path: '/detail/:skuid?',
        component: () =>
            import ('@/page/Detail'),
        meta: { show: true,
            show_header:true },
    },
    {
        name: 'AddCart',
        path: '/addcart/:skuNmb?',
        component: () =>
            import ('@/page/AddCartSuccess'),
        meta: { show: true,
            show_header:true },
    },
    {
        name: 'ShopCart',
        path: '/shopcart',
        component: () =>
            import ('@/page/ShopCart'),
        meta: { show: true,
            show_header:true },
    },
    {
        name: 'Trade',
        path: '/trade',
        component: () =>
            import ('@/page/Trade'),
        // 独享守卫
        beforeEnter: (to, from, next) => {
            // 只有从购物车页而来才可进入结算页
            if (from.path == '/shopcart') {
                next()
            } else {
                // 否则那来回哪去
                next(false)
            }
        },
        meta: { show: true,
            show_header:true },

    },
    {
        name: 'Pay',
        path: '/pay',
        component: () =>
            import ('@/page/Pay'),
        // 独享守卫
        beforeEnter: (to, from, next) => {
            // 只有从结算页而来才可进入支付页
            if (from.path == '/trade') {
                next()
            } else {
                // 否则那来回哪去
                next(false)
            }
        },
        meta: { show: true ,
            show_header:true},
    },
    {
        name: 'PaySuccess',
        path: '/paysuccess',
        component: () =>
            import ('@/page/PaySuccess'),
        // 独享守卫
        beforeEnter: (to, from, next) => {
            // 只有从支付页而来才可进入支付成功页
            if (from.path == '/pay') {
                next()
            } else {
                // 否则那来回哪去
                next(false)
            }
        },
        meta: { show: true ,
            show_header:true},
    },
    {
        name: 'Center',
        path: '/center',
        redirect: '/center/myorder',
        component: () =>
            import ('@/page/Center'),
        meta: { show: true ,
            show_header:true},
        children: [{
                path: 'myorder',
                component: () =>
                    import ('@/page/Center/MyOrder'),
            },
            {
                path: 'grouporder',
                component: () =>
                    import ('@/page/Center/GroupOrder'),
            },

        ]
    },
    {
        name: 'threeD',
        path: '/threeD',
        component: () =>
            import ('@/page/threeD/index'),
        meta: { show: false,
            
            show_header:true,
            show_threeD:false
        },
    },
    {
        name: 'DaoTian',
        path: '/DaoTian',
        component: () =>
            import ('@/page/introduce'),
        meta: { 
            show: false,
            show_header:true,
            show_3Dpic:false
        },
    },
    {
        name: 'goyuan',
        path: '/goyuan',
        component: () =>
            import ('@/page/goyuan/goyuan'),
        meta: { 
            show: false,
            show_header:true,
            show_3Dpic:false
        },
    },
    {
        name: 'gozhibo',
        path: '/gozhibo',
        component: () =>
            import ('@/page/gozhibo/gozhibo.vue'),
        meta: { 
            show: false,
            show_header:true,
            show_3Dpic:false
        },
    },
    {
        name: 'gozhihui',
        path: '/gozhihui',
        component: () =>
            import ('@/page/gozhihui/gozhihui.vue'),
        meta: { 
            show: false,
            show_header:true,
            show_3Dpic:false
        },
    }
]